Unit depourtakip;

Interface

Uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComCtrls, StdCtrls, Grids, Wwdbigrd, Wwdbgrid, Db, ADODB,
  wwdbdatetimepicker, Buttons, siComp;

Type
  Tdepourtakip_f = Class(TForm)
    StatusBar1: TStatusBar;
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    wwDBGrid1: TwwDBGrid;
    wwDBGrid2: TwwDBGrid;
    Label1: TLabel;
    Label2: TLabel;
    t1: TwwDBDateTimePicker;
    t2: TwwDBDateTimePicker;
    Button4: TButton;
    emir: TADOQuery;
    dsemir: TDataSource;
    emirhar: TADOQuery;
    dsemirhar: TDataSource;
    bkapat: TBitBtn;
    Procedure FormClose(Sender: TObject; Var Action: TCloseAction);
    Procedure bkapatClick(Sender: TObject);
    Procedure FormCreate(Sender: TObject);
    Procedure FormShow(Sender: TObject);
    Procedure Button4Click(Sender: TObject);
    Procedure wwDBGrid1CalcCellColors(Sender: TObject; Field: TField;
      State: TGridDrawState; Highlight: Boolean; AFont: TFont;
      ABrush: TBrush);
  Private
    { Private declarations }
  Public
    { Public declarations }
  End;

Var
  depourtakip_f: Tdepourtakip_f;

Implementation

Uses data, ana1;

{$R *.DFM}

Procedure Tdepourtakip_f.FormClose(Sender: TObject;
  Var Action: TCloseAction);
Begin
  Action := cafree;
  depourtakip_f := Nil;
End;

Procedure Tdepourtakip_f.bkapatClick(Sender: TObject);
Begin
  close;
End;

Procedure Tdepourtakip_f.FormCreate(Sender: TObject);
Begin
  t1.Date := SadeceTarih;
  t2.Date := SadeceTarih;

  emir.Close;
  emir.Parameters.ParamByName('t1').value := t1.date;
  emir.Parameters.ParamByName('t2').value := t2.date;
  emir.open;

  emirhar.Open;
End;

Procedure Tdepourtakip_f.FormShow(Sender: TObject);
Begin
  YerAyarla(Self, false);
  t1.SetFocus;
End;

Procedure Tdepourtakip_f.Button4Click(Sender: TObject);
Begin
  emirhar.Close;

  emir.Close;
  emir.Parameters.ParamByName('t1').value := t1.date;
  emir.Parameters.ParamByName('t2').value := t2.date;
  emir.open;

  emirhar.Open;
End;

Procedure Tdepourtakip_f.wwDBGrid1CalcCellColors(Sender: TObject;
  Field: TField; State: TGridDrawState; Highlight: Boolean; AFont: TFont;
  ABrush: TBrush);
Begin
  If emirhar.recordcount > 0 Then
  Begin
    If (emirhar.FieldByName('urunck').text[1] = 'C') Then
    Begin
      AFont.Color := $BBEEFF;
      ABrush.Color := $5050A0;
    End;
  End;
End;

End.